<%#
 Copyright 2013-2020 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see https://www.jhipster.tech/
 for more information.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-%>
# ===================================================================
# Spring Boot configuration for the "gae" profile.
#
# This configuration overrides the application.yml file.
# ===================================================================

# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ===================================================================
server:
    port: ${PORT}
<%_ if (applicationType === 'microservice') { _%>
    servlet:
        context-path: /services/<%= baseName %>
<%_ } _%>
management:
    health:
        diskspace:
            enabled: false
<%_ if (gaeCloudSQLInstanceNeeded === 'Y') { _%>
spring:
    <%_ if (prodDatabaseType === 'mysql' || prodDatabaseType === 'mariadb') { _%>
    datasource:
        type: com.zaxxer.hikari.HikariDataSource
        url: "jdbc:mysql://google/<%= gcpCloudSqlDatabaseName %>?cloudSqlInstance=<%= gcpCloudSqlInstanceName %>&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false"
        username: "<%= gcpCloudSqlUserName %>"
        password: "<%= gcpCloudSqlPassword %>"
        hikari:
            maximumPoolSize: 8
    <%_ } _%>
    <%_ if (prodDatabaseType === 'postgresql') { _%>
    datasource:
        type: com.zaxxer.hikari.HikariDataSource
        url: "jdbc:postgresql://google/<%= gcpCloudSqlDatabaseName %>?cloudSqlInstance=<%= gcpCloudSqlInstanceName %>&socketFactory=com.google.cloud.sql.postgres.SocketFactory"
        username: "<%= gcpCloudSqlUserName %>"
        password: "<%= gcpCloudSqlPassword %>"
        hikari:
            maximumPoolSize: 8
    <%_ } _%>
<%_ } _%>
<%_ if (applicationType === 'microservice' || applicationType === 'gateway') { _%>
jhipster:
    security:
        authentication:
            jwt:
                # This token must be encoded using Base64 and be at least 256 bits long (you can type `openssl rand -base64 64` on your command line to generate a 512 bits one)
                # As this is the PRODUCTION configuration, you MUST change the default key
                # For microservice deployment in GCP this base64-secret must be the same for the Gateway application and all the microservices
                base64-secret: NjA2MzdlMDA2ZjM5NDUwMTc1YmQyZTEzMmY4ZGE3ZmZmYTNlM2M4MmJkMWNhYWY1ZGU0ZDc5NDk3MzBhOGI3ZDVlNWUzZjRkYzhiMjRhMzVlZTYwNWM2ZWNmODYxMjAyNDk5M2U4MWUwNjU5YWU0N2VjNzBmODAxYzRlYmQzODI=
<%_ } _%>
